
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>客户池</title>
    <#include "../common/link.ftl" >
   <script type="text/javascript">
    /*   $(".transferBtn").on("click",function () {
           $("#transferForm input").val("");
           var json = $(this).data("json");
           if(json){
               $("#transferForm input[name='customer.name']").val(json.name);
               $("#transferForm input[name='customer.id']").val(json.id);
               $("#transferForm input[name='oldseller.id']").val(json.sellerId);
               $("#transferForm input[name='oldseller.name']").val(json.sellerName);

           }
           $("#transferModal").modal("show");
       })
       $(".transferSubmit").on("click",function () {
           $("#transferForm").ajaxSubmit(function (data) {
               if(data.success){
                   $.messager.alert("温馨提示","两秒后自动刷新");
                   window.setTimeout(function () {
                       window.location.reload();
                   },2000)
               }else{
                   alert(data.msg);
               }
           })
       })*/
   </script>

    
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <#include "../common/navbar.ftl" >
    <!--菜单回显-->
    <#assign currentMenu="customer_pool"/>
    <#include "../common/menu.ftl" >
    <div class="content-wrapper">
        <section class="content-header">
            <h1>客户池</h1>
        </section>
        <section class="content">
            <div class="box">
                <!--高级查询--->
                <div style="margin: 10px;">
                    <form class="form-inline" id="searchForm" action="/customer/poolList.do" method="post">
                        <input type="hidden" name="currentPage" id="currentPage" value="1">
                        <div class="form-group">
                            <label for="keyword">关键字:</label>
                            <input type="text" class="form-control" id="keyword" name="keyword" value="${qo.keyword!}"
                                   placeholder="请输入姓名/电话">
                        </div>
                        <@shiro.hasAnyRoles name="admin,MARKET_MANAGER">
                        <div class="form-group">
                            <label for="dept"> 销售员:</label>
                            <select class="form-control" id="sellerId" name="sellerId">
                                <option value="-1">全部</option>
                                <#list emps as e>
                                    <option value="${e.id}">${e.name}</option>
                                </#list>
                            </select>
                            <script>
                                $("#sellerId option[value='${qo.sellerId!}']").prop("selected", true);
                            </script>
                        </div>
                        </@shiro.hasAnyRoles>
                        <button id="btn_query" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span>
                            查询
                        </button>
                    </form>
                </div>
                <table class="table table-hover table-bordered">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>名称</th>
                        <th>电话</th>
                        <th>QQ</th>
                        <th>职业</th>
                        <th>来源</th>
                        <th>销售员</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <#list result.list as entity>
                        <tr>
                            <td>${entity_index+1}</td>
                            <td>${(entity.name)!}</td>
                            <td>${(entity.tel)!}</td>
                            <td>${(entity.qq)!}</td>
                            <td>${(entity.job.title)!}</td>
                            <td>${(entity.source.title)!}</td>
                            <td>${(entity.seller.name)!}</td>
                            <td>${(entity.statusName)!}</td>
                            <td>
                                <a class="btn btn-primary btn-xs absorbBtn" data-json='${entity.json}'>
                                    <span class="glyphicon glyphicon-pencil"></span> 吸纳
                                </a>
                                <a class="btn btn-warning btn-xs transferBtn" data-json='${entity.json}'>
                                    <span class="glyphicon glyphicon-pencil"></span>移交
                                </a>
                            </td>
                        </tr>
                    </#list>
                </table>
                <!--分页-->
                <#include "../common/page.ftl" >
            </div>
        </section>
    </div>
    <#include "../common/footer.ftl" >
</div>
<#--
&lt;#&ndash;吸纳&ndash;&gt;
<div class="modal fade" id="absorbModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title inputTitle">跟进</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="/customer/absorb.do" method="post" id="absorbForm">
                    <div class="form-group" >
                        <label  class="col-sm-3 control-label">客户姓名：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="customer.name"  readonly
                            />
                            <input type="hidden" name="customer.id">
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">客户状态：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="oldseller.name" readonly
                            />
                            <input type="hidden" name="oldseller.id">
                        </div>
                    </div>
                    <div class="form-group" >
                        <label  class="col-sm-3 control-label">新营销人员：</label>
                        <div class="col-sm-6">
                            <select class="form-control" name="newseller.id">
                            <#list emps as e >
                                <option value="${e.id}">${e.name}</option>
                            </#list>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">移交原因：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="reason"
                            />
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary absorbSubmit" >保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal" >取消</button>
                    </div>
            </div>
        </div>
    </div>
-->
<#--&lt;#&ndash;移交&ndash;&gt;
<div class="modal fade" id="transferModal">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title inputTitle">跟进</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" action="/customerTransfer/saveOrUpdate.do" method="post" id="transferForm">
                    <div class="form-group" >
                        <label  class="col-sm-3 control-label">客户姓名：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="customer.name"  readonly
                            />
                            <input type="hidden" name="customer.id">
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">客户状态：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="oldseller.name" readonly
                            />
                            <input type="hidden" name="oldseller.id">
                        </div>
                    </div>
                    <div class="form-group" >
                        <label  class="col-sm-3 control-label">新营销人员：</label>
                        <div class="col-sm-6">
                            <select class="form-control" name="newseller.id">
                            <#list emps as e >
                                <option value="${e.id}">${e.name}</option>
                            </#list>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">移交原因：</label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="reason"
                            />
                        </div>
                    </div>

                    <div class="modal-footer">
                        <button type="button" class="btn btn-primary transferSubmit" >保存</button>
                        <button type="button" class="btn btn-default" data-dismiss="modal" >取消</button>
                    </div>
            </div>
        </div>
    </div>-->
</body>
</html>
